package com.heima.user.controller.v1;

import com.heima.apis.user.UserRelationControllerApi;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.UserRelationDto;
import com.heima.user.service.ApUserRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@SuppressWarnings("ALL")
/**
 * @Description :
 * @author     :LD
 */
@RestController
@RequestMapping("api/v1/user")
public class UserRelationController implements UserRelationControllerApi {
    @Autowired
    private ApUserRelationService apUserRelationService;

    @PostMapping("user_follow")
    @Override
    public ResponseResult follow(@RequestBody UserRelationDto dto) {
        return apUserRelationService.follow(dto);
    }

    @GetMapping("user_follow_status")
    @Override
    public boolean getFollowStatus(@RequestParam("userId") Long userId, @RequestParam("followId") Long followId) {
        return apUserRelationService.getFollowStatus(userId,followId);
    }
}
